﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using org.syncsoft.overalt.gui.socket;
using System.Threading;
using System.Collections;
using System.Windows.Forms;
using org.syncsoft.overalt.gui.entities;

namespace org.syncsoft.overalt.gui.TestSocket
{
    class Program
    {
        static void Main(string[] args)
        {

            //string [] array = {"a","b","c","d","e"};
            try
            {

                Console.WriteLine("*********************************\n\n\n");
                bool flag = SocketChannel.GetInstance().Login("thun1", "thunpin");

                Console.WriteLine("*********************************\n\n\n");
                Console.WriteLine(flag.ToString() + "\n\n");

                Console.WriteLine("*********************************\n\n\n");
                Console.WriteLine("Comunidades");
                List<Community> list = SocketChannel.GetInstance().GetComunities();

                foreach (Community com in list)
                {
                    Console.WriteLine("ID: " + com.Id + " DESC: " + com.Description);
                }


                Console.WriteLine("*********************************\n\n\n");
                Console.WriteLine("Membros:");
                List<Members> m = SocketChannel.GetInstance().GetMembers(list[0]);

                foreach (Members mem in m)
                {
                    Console.WriteLine("ID: " + mem.Id + " Name: " + mem.Name);
                }



                Console.WriteLine("*********************************\n\n\n");
                Console.WriteLine("Contatos\n");
                List<Contacts> c = SocketChannel.GetInstance().GetContacts();

                foreach (Contacts cont in c)
                {
                    Console.WriteLine("ID: " + cont.Id + " DESC: " + cont.Description);
                }

                Folder folder = new Folder();
                folder.Path = @"c:\";
                folder.AutoFillTitleDescription = true;

                List<File> f = SocketChannel.GetInstance().GetModifiedFiles(folder);
                foreach (File file in f)
                {
                    Console.WriteLine("id: " + file.VersionDescription + " descrip: " + file.Description);
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show("Falha na comunicação. Detalhe: " + ex.Message);
            }
        }
    }
}
